package com.cci.kangdao.dao;

import com.cci.kangdao.dao.model.WorkOrderPicsSynchroT;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.mybatis.spring.annotation.MapperScan;

import java.util.List;
import java.util.Map;

@MapperScan
public interface UploadPicturesDao {
	/**
	 * 新增现场照片表
	 */
	public int addWorkOrderPics(Map<String, Object> map);
	
	/**
	 * 修改现场照片表
	 */
	public int updateWorkOrderPics(Map<String, Object> map);
	
	/**
	 * 根据工单Id获取照片列表
	 * @param map
	 * @return
	 */
	public List<Map<String,Object>> getPicturesList(Map<String,Object> map);

	//根据工单id和picNo查看图片是否存在
	@Select("select count(ID) from WorkOrderPics_T where OrderId = #{orderId} and PicNo = #{picNo} and Flag = 0")
	int getWorkOrderPicsCountByOrderIdPicNo(@Param("orderId")Long orderId, @Param("picNo")String picNo);

	/**
	 * 新增现场照片表
	 */
	public int addWorkOrderPicsSynchro(WorkOrderPicsSynchroT workOrderPicsSynchroT);
}
